package com.code;

/**
 * @description:  实现Runnable接口开启线程
 * @author: lwh
 * @date: Created in 2020/3/17 16:46
 * @modified By:
 */

public class ThreadDemo02 implements Runnable{
    @Override
    public void run() {

        for (int i = 0; i < 5; i++) {
            System.out.println("我是子线程"+i);
        }
    }

    public static void main(String[] args) {

        ThreadDemo02 thread = new ThreadDemo02();

        new Thread(thread).start();

        for (int i = 0; i < 6; i++) {
            System.out.println("执行主线程"+i);
        }
    }
}
